
let getJsonData = function(url) {
    
    var jqXHR = $.ajax({
        url: url,
        async: false});

    return $.parseJSON(jqXHR.responseText);
}

var imageboards = getJsonData('imageboards.json')

for (i in imageboards) {

    var currentBoard = imageboards[i];

    $('#imageboardsContainer').append(`
    
        <tr>
            <td>` + (i - -1) + `</td>
            <td>` + currentBoard.language.join(', ').toUpperCase() + `</td>
            <td> <a target = "_blank" href = '`+ currentBoard.url +`'>` + currentBoard.name + `</a> </td>
            <td style = '` + (currentBoard.software ? currentBoard.software.join(', ') : 'color: #a2a1a1') + `'>` + (currentBoard.software ? currentBoard.software.join(', ') : '[not stated]') + `</td>
        </tr>

    `)

}